package edu.gatech.bsbmule.view;

import java.awt.Color;
import java.awt.Point;
import java.awt.event.MouseAdapter;

import javax.swing.JLabel;

import edu.gatech.bsbmule.model.Player;
import edu.gatech.bsbmule.model.Tile;

/**
 * View interface of map screen
 * 
 * @author BSB
 * @version 1.0 10/26/2013
 */
public interface IMapScreen {
	
	/**
	 * Display JLabels on the panel according to each tile's position and terrain
	 * 
	 * @param tiles 2d primitive array of tiles
	 */
	public void displayTiles(Tile[][] tiles);
	
	/**
	 * Set all tiles with a specific listener when clicked
	 * 
	 * @param e listener
	 */
	public void setTileListener(MouseAdapter e);
	
	/**
	 * Give the location of a tile according to a JLabel(usually clicked)
	 * 
	 * @param label JLabel to be searched
	 * @return the location of tile this JLabel represents
	 */
	public Point queryLocationByJLabel(JLabel label);
	
	/**
	 * Mark a specific tile with a color boarder
	 * 
	 * @param point position of a tile
	 * @param color color marked
	 * 
	 */
	public void updateJLabelColor(Point point, Color color);
	
	/**
	 * Update player's information in the information panel
	 * 
	 * @param player
	 */
	public void updatePlayerInfo(Player player);
	
	/**
	 * Set the turn number in status bar in the view
	 * @param String turn
	 */
	public void setTurnStatus(String turn);
	
	/**
	 * Set the trading status (aka Land Office or not) in status bar in the view
	 * @param String trading
	 */
	public void setTradingStatus(String trading);
	
	/**
	 * Set the free property status in status bar in the view
	 * @param string free
	 */
	public void setFreePropertyStatus(String free);
	
	/**
	 * Get whether the tiles in the view is in trade (aka is in land office or not)
	 * @return isClickable
	 */
	public boolean getIntrade();
	
	/**
	 * Set whether the tiles in the view is in trade (aka is in land office or not)
	 * 
	 * @param isClickable
	 */
	public void setIntrade(boolean inTrade);
	
	/**
	 * Append a log message into the log window
	 * 
	 * @param s string to be appended
	 */
	public void appendLog(String s);
	
	/**
	 * Start counting one second for displaying time
	 */
	public void startOneSecTimer();
	
	/**
	 * End the timer above
	 */
	public void stopOneSecTimer();
	
	/**
	 * 
	 * @return true if with Mule 
	 */
	public boolean isWithMule();
	
	/**
	 * @param p represents  a player object
	 * @return true if the player has a mule
	 */
	public boolean hasMule(Player p);
	
	/**
	 * @param mule
	 */
	public void setWithMule(boolean mule);
}
